package com.kczd.jinlan.fragment.smallfragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.kczd.jinlan.R;
import com.kczd.jinlan.adapter.normaladapter.ExpendAdapter;
import com.kczd.jinlan.model.Expend;

import java.util.ArrayList;
import java.util.List;

/**
 * yang_g
 * 余额支出
 * Created by Administrator on 2017/5/19.
 */

public class ExpenditureFragment extends Fragment {
    private View view;
    private ListView list_expend;
    private List<Expend> datas;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.expenditure_fragment, container, false);
        initdata();
        init();
        return view;
    }

    private void initdata() {
        datas=new ArrayList<>();
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
        datas.add(new Expend("支付鸡蛋5Kg","2017-04-27","-￥ 60.00"));
    }

    private void init() {
        list_expend = (ListView) view.findViewById(R.id.list_expend);
        list_expend.setAdapter(new ExpendAdapter(datas));
    }



}
